package org.example.realtime.gongdan.log.entity;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
 * @Title: UserLocation
 * @Author Lianzy
 * @Package org.example.realtime.gongdan.log.entity
 * @Date 2025/6/12 15:02
 * @description
 */
public class UserLocation {
    private long userId;
    private BigDecimal latitude;
    private BigDecimal longitude;
    private Timestamp behaviorTime;
    private Timestamp updateTime;
    private String provinceName;
    private String cityName;
    private String districtName;
    private String adcode;
    private String errorCode;
    private String errorMsg;

    public UserLocation() {}

    public UserLocation(long userId, BigDecimal latitude, BigDecimal longitude, Timestamp behaviorTime) {
        this.userId = userId;
        this.latitude = latitude;
        this.longitude = longitude;
        this.behaviorTime = behaviorTime;
    }

    // Getters
    public long getUserId() { return userId; }
    public BigDecimal getLatitude() { return latitude; }
    public BigDecimal getLongitude() { return longitude; }
    public Timestamp getBehaviorTime() { return behaviorTime; }
    public Timestamp getUpdateTime() { return updateTime; }
    public String getProvinceName() { return provinceName; }
    public String getCityName() { return cityName; }
    public String getDistrictName() { return districtName; }
    public String getAdcode() { return adcode; }
    public String getErrorCode() { return errorCode; }
    public String getErrorMsg() { return errorMsg; }

    // Setters
    public void setUserId(long userId) { this.userId = userId; }
    public void setLatitude(BigDecimal latitude) { this.latitude = latitude; }
    public void setLongitude(BigDecimal longitude) { this.longitude = longitude; }
    public void setBehaviorTime(Timestamp behaviorTime) { this.behaviorTime = behaviorTime; }
    public void setUpdateTime(Timestamp updateTime) { this.updateTime = updateTime; }
    public void setProvinceName(String provinceName) { this.provinceName = provinceName; }
    public void setCityName(String cityName) { this.cityName = cityName; }
    public void setDistrictName(String districtName) { this.districtName = districtName; }
    public void setAdcode(String adcode) { this.adcode = adcode; }
    public void setErrorCode(String errorCode) { this.errorCode = errorCode; }
    public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; }

    public void setError(String code, String msg) {
        this.errorCode = code;
        this.errorMsg = msg;
    }

    public void clearError() {
        this.errorCode = null;
        this.errorMsg = null;
    }
    // 重写 toString() 方法
    @Override
    public String toString() {
        return "UserLocation{" +
                "userId=" + userId +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", behaviorTime=" + behaviorTime +
                ", updateTime=" + updateTime +
                ", provinceName='" + provinceName + '\'' +
                ", cityName='" + cityName + '\'' +
                ", districtName='" + districtName + '\'' +
                ", adcode='" + adcode + '\'' +
                ", errorCode='" + errorCode + '\'' +
                ", errorMsg='" + errorMsg + '\'' +
                '}';
    }
}